1. Field of the Invention
The present invention relates to an image processing apparatus and method for performing image processing on an input image, and in particular, relates to image processing for dynamic range transformation.
2. Description of the Related Art
In recent years, digital X-ray photographing apparatuses capable of outputting X-ray image data in digital form are becoming widespread as medical X-ray photographing apparatuses. Image processing is indispensable to such a digital X-ray photographing apparatus. The digital X-ray photographing apparatus (image processing apparatus) uses a variety of image processing on X-ray image data. One of important image processing is gray scale transformation processing for transforming captured x-ray image data into an image having easier-to-observe densities (brightnesses) and contrast.
As for the shape of a function used in the above-described gray scale transformation processing, for example, an S-shaped function as shown in FIG. 8 is generally used. This shape is similar to that of the characteristic curve for a silver-halide film. FIG. 8 is a prior art schematic diagram illustrating a characteristic curve used in typical gray scale transformation processing, the characteristic curve showing the relationship between an input pixel value and an output density value. A method of generating an S-shaped characteristic curve (gray scale transformation curve) shown in FIG. 8 is disclosed in, for example, Japanese Patent Laid-Open No. 11-88688. The method disclosed in Japanese Patent Laid-Open No. 11-88688 uses a function expressed by the following equation (5).
                              D          ⁡                      (            x            )                          =                              OD                          m              ⁢                                                          ⁢              i              ⁢                                                          ⁢              n                                +                                                                      OD                                      ma                    ⁢                                                                                  ⁢                    x                                                  -                                  OD                                      m                    ⁢                                                                                  ⁢                    i                    ⁢                                                                                  ⁢                    n                                                              2                        ⁢                          {                                                                                                                  1                                                  1                          +                                                      exp                            ⁡                                                          (                                                              c                                ⁡                                                                  (                                                                                                                                                                                                                                          x                                            0                                                                                    -                                                                                                                                                                                                                                                                              (                                                                                      x                                            -                                            d                                                                                    )                                                                                                                                                                                      )                                                                                            )                                                                                                                          +                                                                                                                                  1                                              1                        +                                                  exp                          ⁡                                                      (                                                          a                              ⁢                                                                                                                          ⁢                                                              c                                ⁡                                                                  (                                                                                                                                                                                                                                          bx                                            0                                                                                    -                                                                                                                                                                                                                                                                              (                                                                                      x                                            -                                            d                                                                                    )                                                                                                                                                                                      )                                                                                                                      )                                                                                                                                                          }                                                          (        5        )            
In the equation (5), let ODmax and ODmin be a maximum output density and a minimum output density, and let a and b denote constants. In addition, let c denote a grading and let d be an amount of translation. Changing those two parameters c and d can adjust densities and contrast in a desired region of interest to optimum values.
FIG. 9 is a prior art schematic diagram explaining an example of a method of transforming the gray scale of image data relating to X-ray photography in chest. In X-ray photography in chest, the region of most interest is typically a lung region. Accordingly, the parameters c and d are changed to provide such a contrast that a representative value (e.g., mean value) in lung regions indicates a predetermined density (for example, a density of 1.8D), thus optimally adjusting densities and contrast in the lung regions.
In the above-described gray scale transformation processing, in some cases, it is difficult to set the whole of a subject area within an optimum density range while maintaining contrast in a region of interest, depending on the body size of a subject or part of the body. For example, in X-ray photography in chest, since the chest includes lung regions where an X-ray is easy to pass and a mediastinum region where an X-ray is hard to pass, the dynamic range of a subject is very wide. Accordingly, when the contrast in the lung regions is optimized using the gray scale transformation function (gray scale transformation curve) shown in FIG. 9, densities in the mediastinum region become too low. Disadvantageously, in some cases, it is difficult to simultaneously observe the lung regions and the mediastinum region.
To overcome such a disadvantage, a typical method compresses the dynamic range of an image while keeping contrast in a fine-structure portion prior to gray scale transformation. For example, when let Sorg be an input image and Sus denote a blurred image obtained by moving averages of the input image using a mask size of M×M pixels, this method is expressed by the following equation (6).Sproc=Sorg+f(Sus)  (6)
A function “f( )” in the equation (6) is a generally monotonically decreasing function as shown in FIG. 10. FIG. 10 is a prior art schematic diagram illustrating a dynamic range transformation function.
The equation (6) can also be expressed as the following equation (7).
                                                                        S                proc                            =                            ⁢                                                (                                                            S                      org                                        -                    Sus                                    )                                +                                  (                                                            f                      ⁡                                              (                        Sus                        )                                                              +                    Sus                                    )                                                                                                        =                            ⁢                                                (                                                            S                      org                                        -                    Sus                                    )                                +                                  f                  ⁢                                                                          ⁢                  1                  ⁢                                      (                    Sus                    )                                                                                                          (        7        )            
A function “f1( )” in the equation (7) is expressed as a generally monotonically increasing function as shown in FIG. 11. FIG. 11 is a prior art schematic diagram showing an example of a dynamic range transformation function. Since “Sorg−Sus” in the equation (7) corresponds to a high frequency component, this function can be regarded as gray scale transformation limited only to a low frequency component. Densities of a finally output image are obtained as a combination of the function “f1( )” in the equation (7) and the gray scale transformation function in the equation (5). Advantageously, therefore, densities in a low density region, such as the mediastinum region, can be increased.
When the function “f( )” in the equation (6) is changed, densities in a high density region, such as a skin, can be reduced. This method is disclosed in Japanese Patent No. 2663189. In the background of the above-described image processing techniques, however, the related-art methods have the following disadvantages.
As for the technique disclosed in Japanese Patent Laid-Open No. 11-88688, although densities and contrast in a region of interest are optimized, a variation in dynamic range due to individual differences among subjects is not taken into consideration. Accordingly, in some cases, the whole of a subject is not set within an optimum density range. A reduction in the gradient of a gray scale transformation curve using the grading c can allow the whole of the subject to be set within the optimum density range. In this case, however, since the gradient of the gray scale transformation curve cannot be partially adjusted, contrast in a region of interest has to be sacrificed. In other words, it is difficult to optimally adjust the gray scale transformation curve in accordance with the dynamic range of the subject while maintaining the contrast in the region of interest.
According to the technique disclosed in Japanese Patent No. 2663189, it is possible to set the whole of a subject within an optimum density range. In the above-described techniques, however, a process of setting the whole of a subject within an optimum density range is regarded as independent of the gray scale transformation processing. How the effect of this process is reflected in an image which has undergone gray scale transformation is not taken into consideration. Therefore, there is no guarantee that the dynamic range of a subject is surely set within an optimum density range after gray scale transformation. For example, in a case shown in FIG. 11, the gradient is constant in a range where the parameter Sus is at or below a value Base. Disadvantageously, the dynamic range is uniformly compressed in a region of interest or in the vicinity thereof where it is not preferable to compress the dynamic range, depending on the set value Base.